#ifndef __RELAY_H__
#define __RELAY_H__

#include "stm32f10x.h"

#define RELAY_ACT_ON    1
#define RELAY_ACT_OFF   0

typedef struct {
    unsigned short int active_low;
    unsigned short int pin;
    GPIO_TypeDef *port; 
} relay_dev_t;

extern relay_dev_t relay_array[2];

extern void relay_init(void);
extern void relay_on(relay_dev_t *dev);
extern void relay_off(relay_dev_t *dev);
extern void relay_op(relay_dev_t *dev, int operation);

#endif /* __RELAY_H__ */
